<include file="Public/header"/>
<include file="Public/menu"/>

<!-- 内容页 -->
<div class="content-wrapper">
    <!-- 面包屑 -->
    <section class="content-header">
        <h1>
            全国送会员订单
            <small>订单详细</small>
        </h1>
    </section>

    <!-- 内容 -->

    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="nav-tabs-custom">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#tab_0" data-toggle="tab">订单详情</a></li>
                        <li>
                            <a href="{:U('QgsOrders/orderLog',array('id'=>$orDetail['product'][0]['order_id']))}">订单日志</a>
                        </li>
                        <li class="pull-right header">
                        </li>
                    </ul>
                    <div class="tab-content">
                        <div class="tab-pane active" id="tab_0">
                            <div class="box box-info">
                                <div class="box-header with-border">
                                    <h3 class="box-title">编辑：订单号[{$orDetail['product'][0]['order_id']}]</h3>
                                    <div class="box-tools">
                                        <div class="btn-group pull-right" style="margin-right: 10px">
                                            <a href="{:U('QgsOrders/orderList',['view'=>I('view')])}"
                                               class="btn btn-sm btn-warning item_delete"><i class="fa fa-list"></i>&nbsp;返回上一页</a>
                                        </div>
                                    </div>
                                </div>
                                <!-- /.box-header -->
                                <!-- form start -->
                                <div class="box-body">
                                    <div class="form-group">
                                        <table class="table table-hover" style="margin-left: 10px; width: 99%;">
                                            <tbody>
                                            <tr>
                                                <th>商品货号</th>
                                                <th>货品名称</th>
                                                <th>商品条形码</th>
                                                <th>已发货量</th>
                                                <th>单价</th>
                                                <th>购买数量</th>
                                                <th>合计金额</th>
                                            </tr>
                                            <volist name="orDetail.product" id="item">
                                                <tr>
                                                    <td>{$item.bn}</td>
                                                    <td>{$item.name}</td>
                                                    <td>{$item.barcode}</td>
                                                    <td>{$item.sendnum}</td>
                                                    <td>￥{$item.price|number_format=###, 2, '.', ''}</td>
                                                    <td>{$item.nums}</td>
                                                    <td>￥{$item.amount|number_format=###, 2, '.', ''}</td>
                                                </tr>
                                            </volist>
                                            </tbody>
                                        </table>
                                        <div class="box-footer"></div>
                                    </div>

                                    <if condition="$isrefund neq NULL">
                                        <div class="form-group">
                                            <div class="box-header with-border">
                                                <h3 class="box-title" style="color: #ff0000">[客户申请（发货前：退款）]</h3>
                                            </div>
                                            <table class="table table-hover" style="margin-left: 10px; width: 99%;">
                                                <tbody>
                                                <tr>
                                                    <th>&nbsp;</th>
                                                    <th>商品货号</th>
                                                    <th>货品名称</th>
                                                    <th>商品条形码</th>
                                                    <th>已发货量</th>
                                                    <th>单价</th>
                                                    <th>购买数量</th>
                                                    <th>申请退款|退货退款数量</th>
                                                </tr>
                                                <volist name="isrefund" id="item">
                                                    <tr>
                                                        <td>{$item.istype}</td>
                                                        <td>{$item.bn}</td>
                                                        <td>{$item.name}</td>
                                                        <td>{$item.barcode}</td>
                                                        <td>{$item.sendnum}</td>
                                                        <td>￥{$item.price|number_format=###, 2, '.', ''}</td>
                                                        <td>{$item.nums}</td>
                                                        <td>{$item.num}</td>
                                                    </tr>
                                                </volist>
                                                </tbody>
                                            </table>
                                            <div class="box-footer"></div>
                                        </div>
                                    </if>

                                    <if condition="$isrefundtwo neq NULL">
                                        <div class="form-group">
                                            <div class="box-header with-border">
                                                <h3 class="box-title" style="color: #ff0000">[客户申请（发货后退款商品）]</h3>
                                            </div>
                                            <table class="table table-hover" style="margin-left: 10px; width: 99%;">
                                                <tbody>
                                                <tr>
                                                    <th>&nbsp;</th>
                                                    <th>商品货号</th>
                                                    <th>货品名称</th>
                                                    <th>商品条形码</th>
                                                    <th>已发货量</th>
                                                    <th>单价</th>
                                                    <th>购买数量</th>
                                                    <th>申请退款|退货退款数量</th>
                                                </tr>
                                                <volist name="isrefundtwo" id="item">
                                                    <tr>
                                                        <td>{$item.istype}</td>
                                                        <td>{$item.bn}</td>
                                                        <td>{$item.name}</td>
                                                        <td>{$item.barcode}</td>
                                                        <td>{$item.sendnum}</td>
                                                        <td>￥{$item.price|number_format=###, 2, '.', ''}</td>
                                                        <td>{$item.nums}</td>
                                                        <td>{$item.num}</td>
                                                    </tr>
                                                </volist>
                                                </tbody>
                                            </table>
                                            <div class="box-footer"></div>
                                        </div>
                                    </if>
                                    <if condition="$isrefundtree neq NULL">
                                        <div class="form-group">
                                            <div class="box-header with-border">
                                                <h3 class="box-title" style="color: #ff0000">[客户申请（退货退款商品）]</h3>
                                            </div>
                                            <table class="table table-hover" style="margin-left: 10px; width: 99%;">
                                                <tbody>
                                                <tr>
                                                    <th>&nbsp;</th>
                                                    <th>商品货号</th>
                                                    <th>货品名称</th>
                                                    <th>商品条形码</th>
                                                    <th>已发货量</th>
                                                    <th>单价</th>
                                                    <th>购买数量</th>
                                                    <th>申请退款|退货退款数量</th>
                                                </tr>
                                                <volist name="isrefundtree" id="item">
                                                    <tr>
                                                        <td>{$item.istype}</td>
                                                        <td>{$item.bn}</td>
                                                        <td>{$item.name}</td>
                                                        <td>{$item.barcode}</td>
                                                        <td>{$item.sendnum}</td>
                                                        <td>￥{$item.price|number_format=###, 2, '.', ''}</td>
                                                        <td>{$item.nums}</td>
                                                        <td>{$item.num}</td>
                                                    </tr>
                                                </volist>
                                                </tbody>
                                            </table>
                                            <div class="box-footer"></div>
                                        </div>
                                    </if>

                                    <div id="example2_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
                                        <div class="row">
                                            <div class="col-sm-6"></div>
                                            <div class="col-sm-6"></div>
                                        </div>
                                        <div class="row">
                                            <div class="col-sm-12">
                                                <table id="example2" class="table table-bordered table-hover dataTable"
                                                       role="grid" aria-describedby="example2_info">
                                                    <thead>
                                                    <tr role="row">
                                                        <th class="sorting_asc" tabindex="0" rowspan="1" colspan="1">
                                                            商品价格
                                                        </th>
                                                        <th class="sorting" tabindex="0" rowspan="1" colspan="1">收货人信息
                                                        </th>
                                                        <th class="sorting" tabindex="0" rowspan="1" colspan="1">售后信息
                                                        </th>
                                                    </thead>
                                                    <tbody>
                                                    <tr role="row" class="odd">
                                                        <td class="sorting_1">商品总额
                                                            :￥{$orDetail['detail']['cost_item']|number_format=###, 2,
                                                            '.', ''}
                                                        </td>
                                                        <td>姓名:{$orDetail['detail']['ship_name']}</td>
                                                        <td>退款运费:￥{$refundInfo.yunfei}</td>
                                                    </tr>
                                                    <tr role="row" class="odd">
                                                        <td class="sorting_1">配送费用
                                                            ：￥{$orDetail['detail']['cost_freight']|number_format=###, 2,
                                                            '.', ''}
                                                        </td>
                                                        <td>手机:{$orDetail['detail']['ship_mobile']}</td>
                                                        <td>退款金额:￥{$refundInfo.itemMoney}</td>
                                                    </tr>
                                                    <tr role="row" class="odd">
                                                        <td class="sorting_1">优惠抵扣金额
                                                            ：￥{$orDetail['detail']['youhui']|number_format=###, 2, '.',
                                                            ''}
                                                        </td>
                                                        <td></td>
                                                        <td>实际申请退款金额：￥{$refundInfo.totalMoney}</td>
                                                    </tr>
                                                    <tr role="row" class="odd">
                                                        <td class="sorting_1">订单总额 :
                                                            ￥{$orDetail['detail']['total_amount']|number_format=###, 2,
                                                            '.', ''}
                                                        </td>
                                                        <td></td>
                                                        <td>退款原因:{$refundInfo.message}</td>
                                                    </tr>
                                                    <tr role="row" class="odd">
                                                        <td>已支付金额：￥{$orDetail['detail']['payed']|number_format=###, 2,
                                                            '.', ''}
                                                        </td>
                                                        <td></td>
                                                        <td></td>
                                                    </tr>
                                                    </tbody>
                                                </table>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!-- /.box-body -->
                                <!-- /.box-footer -->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </section>
</div>
<!-- 底部 -->
<include file="Public/common_footer"/>
<script src="/Public/layer/layer.js"></script>


<script data-exec-on-popstate>
    $(function () {
        $('.suggest').on('click', function () {

            var dataId = $(this).data('id');

            layer.ready(function () {
                layer.open({
                    type: 2,
                    title: '订单管理',
                    fix: false,
                    maxmin: true,
                    shadeClose: true,
                    area: ['1000px', '750px'],
                    content: dataId,
                    end: function () {
                        layer.tips('Hi', '#about', {tips: 1})
                    }
                });
            });
        });

        $('.grid-select-all').change(function () {
            if (this.checked) {
                $('.grid-item').prop("checked", true);
            } else {
                $('.grid-item').prop("checked", false);
            }
        });

        $('.batch-delete').on('click', function () {
            var selected = [];
            $('.grid-item:checked').each(function () {
                selected.push($(this).data('id'));
            });

            if (selected.length == 0) {
                return;
            }

            if (confirm("Are you sure to delete this item ?")) {
                $.post('/Qgs/auth/roles/' + selected.join(), {
                    _method: 'delete',
                    '_token': 'ALpaP7hXZ6s2dnAdE02Z6mUSHPt8RkYbcDRp6rpw'
                }, function (data) {
                    $.pjax.reload('#pjax-container');
                    noty({
                        text: "<strong>Succeeded!</strong>",
                        type: 'success',
                        timeout: 1000
                    });
                });
            }
        });
    });
</script>